'''
Created on 06/07/2012

@author: mekoda
'''

from main.process import PCB, Instruction, Process, ProcessStatus, IOInstruction, ProcessStates
from main.os import OS_Factory

pcb1 =  PCB(3)
pcb1.processID = 1
pcb2 =  PCB(6)
pcb2.processID = 2
pcb3 =  PCB(7)
pcb3.processID = 3
instruction1 =  Instruction(ProcessStatus.CPU,1)#proceso1 es de Cpu
instruction2 =  Instruction(ProcessStatus.CPU,2)
instruction3 =  Instruction(ProcessStatus.CPU,3)
instruction4 =  IOInstruction(4,'Printer')
instruction5 =  Instruction(ProcessStatus.CPU,5)
instruction6 =  IOInstruction(6,'Printer')
instruction7 =  Instruction(ProcessStatus.CPU,7)
instruction8 =  IOInstruction(8,'Printer')
instruction9 =  IOInstruction(9,'Printer')
instruction10=  Instruction(ProcessStatus.CPU,10)
#------------------------------------------#
process1 = Process(pcb1)
process1.addInstruction(instruction1)
process1.addInstruction(instruction2)
process1.addInstruction(instruction3)
process1.addInstruction(instruction4)
#------------------------------------------#
process2 = Process(pcb2)
process2.addInstruction(instruction5)
process2.addInstruction(instruction6)
process2.addInstruction(instruction7)
#------------------------------------------#
process3 = Process(pcb3)
process3.addInstruction(instruction8)
process3.addInstruction(instruction9)
process3.addInstruction(instruction10)
#------------------------------------------#
os = OS_Factory.newRR_OS(5)
os.addNewProcess(process1)
os.addNewProcess(process2)
os.addNewProcess(process3)
os.start()